package com.by.feign.client;

import com.by.api.dto.CarDto;
import com.by.common.core.bean.ResultBean;
import com.by.feign.dto.SkuDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "goods-service")
public interface SkuRemoteClient {
    /**
     * 根据id查询sku信息
     * @param id
     * @return
     */
    @GetMapping("/feign/sku")
    ResultBean<SkuDto> querySku(@RequestParam("id") int id);

    /**
     * 锁定库存
     * @param carDtoList
     * @return
     */
    @PutMapping("/feign/sku/stock")
    ResultBean  lockSkuStock(@RequestBody List<CarDto> carDtoList);
}
